﻿using UnityEngine;
using System.Collections;

public class FinnishMenu : MonoBehaviour {

	public GUIStyle _style;
	public int _xBorder;
	public int _yBorder;
	public int _xStart;
	public int _yStart;
	public int _xQuit;
	public int _yQuit;
	public int _width;
	public int _height;

	private GameObject scoreBoard;

	// Use this for initialization
	void Start () {
		scoreBoard = GameObject.Find("scorceBoard");
	}
	
	// Update is called once per frame
	void Update () {
		}


	void OnGUI() {
		GUI.Label (
			new Rect(
				_xBorder,
				_yBorder,
				_width, 
				_height
			),
			"Welldone",
			_style);

		if (GUI.Button (
			new Rect (
				_xStart,
				_yStart, 
				_width, 
				_height
			),
	           "Replay",
	           _style
			)
		) {
				if (scoreBoard != null) {
					Destroy(scoreBoard);
				}
				Application.LoadLevel(1);
			}

		if (GUI.Button (
			new Rect (
			_xQuit,
			_yQuit, 
			_width, 
			_height
			),
			"Leave Game",
			_style
			)
		    ) {
			Application.Quit();
		}


	}
}
